import type { FundedDetailVO, FundedDetailForm, FundedDetailQuery } from './model';

import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
* 查询垫资详情列表
* @param params
* @returns 垫资详情列表
*/
export function fundedDetailList(params?: FundedDetailQuery) {
  return requestClient.get<PageResult<FundedDetailVO>>('/trade/fundedDetail/list', { params });
}

/**
 * 导出垫资详情列表
 * @param params
 * @returns 垫资详情列表
 */
export function fundedDetailExport(params?: FundedDetailQuery) {
  return commonExport('/trade/fundedDetail/export', params ?? {});
}

/**
 * 查询垫资详情详情
 * @param id id
 * @returns 垫资详情详情
 */
export function fundedDetailInfo(id: ID) {
  return requestClient.get<FundedDetailVO>(`/trade/fundedDetail/${id}`);
}

/**
 * 新增垫资详情
 * @param data
 * @returns void
 */
export function fundedDetailAdd(data: FundedDetailForm) {
  return requestClient.postWithMsg<void>('/trade/fundedDetail', data);
}

/**
 * 更新垫资详情
 * @param data
 * @returns void
 */
export function fundedDetailUpdate(data: FundedDetailForm) {
  return requestClient.putWithMsg<void>('/trade/fundedDetail', data);
}

/**
 * 删除垫资详情
 * @param id id
 * @returns void
 */
export function fundedDetailRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/trade/fundedDetail/${id}`);
}
